<?php

namespace App\Services\ReceiveProductOrder;

use App\Http\Controllers\Api\V1\Requests\FormRequest;

class ReceiveProductOrderRequest extends FormRequest
{
	public function rules()
	{
		$this->verify();
		
		return [];
	}
	
	public function verify()
	{
		$order = $this->order;
		
		if ($order->delivery_status == 'pending') {
			fail('目标订单未发货');
		} elseif ($order->delivery_status == 'received') {
			fail('目标订单已收货');
		}
		
		return true;
	}
}
